﻿using System;

namespace SCSInternetBanking.LibertyReserve
{
    public static class AccountNameSample
    {
        private static readonly ApiCredentials g_credentials = new ApiCredentials()
        {
            AccountNumber = "U1234567",
            ApiName = "ApiName",
            SecurityWord = "SecurityWord",
        };

        static void Main(string[] args)
        {
            IApiAgent agent = ApiAgentFactory.Create(ApiProtocol.Xml, g_credentials);
            agent.RequireValidSslCertificate = true;

            try
            {
                string name = agent.AccountName("U1234567");
                Console.WriteLine("AccountName: {0}", name ?? "N/A");
            }
            catch (ApiException ex)
            {
                Console.Error.WriteLine(ex); 
            }
        }
    }
}
